package com.ruoyi.dgdData.service.impl;

import java.util.List;
import java.util.concurrent.Future;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.dgdData.domain.plat.DataDgdYl;
import com.ruoyi.dgdData.mapper.DataDgdYlMapper;
import com.ruoyi.dgdData.service.IDataDgdYlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;


/**
 * 单轨吊压力测试数据Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-28
 */
@Service
public class DataDgdYlServiceImpl implements IDataDgdYlService
{
    @Autowired
    private DataDgdYlMapper dataDgdYlMapper;

    /**
     * 查询单轨吊压力测试数据
     * 
     * @param ydId 单轨吊压力测试数据主键
     * @return 单轨吊压力测试数据
     */
    @Override
    public DataDgdYl selectDataDgdYlByYdId(Long ydId)
    {
        return dataDgdYlMapper.selectDataDgdYlByYdId(ydId);
    }

    /**
     * 查询单轨吊压力测试数据
     *
     * @param dataTaskId
     * @return 单轨吊压力测试数据
     */
    @Override
    public Future<List<DataDgdYl>> selectDataDgdYlByDataTaskId(Long dataTaskId) {
        return new AsyncResult<>(dataDgdYlMapper.selectDataDgdYlByDataTaskId(dataTaskId));
    }

    /**
     * 查询单轨吊压力测试数据列表
     * 
     * @param dataDgdYl 单轨吊压力测试数据
     * @return 单轨吊压力测试数据
     */
    @Override
    public List<DataDgdYl> selectDataDgdYlList(DataDgdYl dataDgdYl)
    {
        return dataDgdYlMapper.selectDataDgdYlList(dataDgdYl);
    }

    /**
     * 新增单轨吊压力测试数据
     * 
     * @param dataDgdYl 单轨吊压力测试数据
     * @return 结果
     */
    @Override
    public int insertDataDgdYl(DataDgdYl dataDgdYl)
    {
        dataDgdYl.setCreateTime(DateUtils.getNowDate());
        return dataDgdYlMapper.insertDataDgdYl(dataDgdYl);
    }

    /**
     * 批量新增压力测试数据
     *
     * @param dataDgdYls
     */
    @Override
    public int batchDataDgdYl(List<DataDgdYl> dataDgdYls) {
        return dataDgdYlMapper.batchDataDgdYl(dataDgdYls);
    }

    /**
     * 修改单轨吊压力测试数据
     * 
     * @param dataDgdYl 单轨吊压力测试数据
     * @return 结果
     */
    @Override
    public int updateDataDgdYl(DataDgdYl dataDgdYl)
    {
        dataDgdYl.setUpdateTime(DateUtils.getNowDate());
        return dataDgdYlMapper.updateDataDgdYl(dataDgdYl);
    }

    /**
     * 变更单轨吊压力数据状态为2
     *
     * @param ydId
     * @return 结果
     */
    @Override
    public int updateDataDgdYlByYdId(Long ydId) {
        return dataDgdYlMapper.updateDataDgdYlByYdId(ydId);
    }

    /**
     * 变更单轨吊压力数据状态为2
     *
     * @param dataTaskId
     * @return 结果
     */
    @Override
    public int updateDataDgdYlByDataTaskId(Long dataTaskId) {
        return dataDgdYlMapper.updateDataDgdYlByDataTaskId(dataTaskId);
    }

    /**
     * 批量删除单轨吊压力测试数据
     * 
     * @param ydIds 需要删除的单轨吊压力测试数据主键
     * @return 结果
     */
    @Override
    public int deleteDataDgdYlByYdIds(Long[] ydIds)
    {
        return dataDgdYlMapper.deleteDataDgdYlByYdIds(ydIds);
    }

    /**
     * 删除单轨吊压力测试数据信息
     * 
     * @param ydId 单轨吊压力测试数据主键
     * @return 结果
     */
    @Override
    public int deleteDataDgdYlByYdId(Long ydId)
    {
        return dataDgdYlMapper.deleteDataDgdYlByYdId(ydId);
    }
}
